const { Article } = require('../../model/article');
const pagination = require('mongoose-sex-page');

module.exports = async(req, res) => {
    const page = req.query.page;
    const result = await pagination(Article).size(4).page(page).display(5).find().populate('author').exec();
    // res.send(result);
    // return;
    res.render('home/default.art', {
        result: result
    });
}